DEBUG = 1

SOURCE_FOR_C = $(foreach source_file_1, $(SOURCES),$(filter %.c, $(source_file_1)))
#DEPENDS_C    = $(addprefix obj/,$(SOURCE_FOR_C:.c=.c.d))
#OBJS         = $(DEPENDS_C:.c.d=.o)
OBJS         = $(SOURCE_FOR_C:.c=.o)

CFLAGS += -I$(INCLUDE_DIR) -Werror
ifeq (1,$(DEBUG))
CFLAGS += -g
endif

.PYONY:all clean
all:$(TARGET)
$(TARGET):$(OBJS)
	$(CC) $(CFLAGS) $^ -o $@

clean:
	@echo "[CLEAN]"
	@rm -rfv  *.o *.d *.tmp *.bin *.spz *.spgzip *.lzma *.text $(OBJS) $(DEPENDS) obj *.bak
	@rm -rfv $(TARGET)